﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SuperMarketSystem
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Trans trans = new Trans();//新建一个传递控制类用于选择功能
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Login(ref trans));//开启一个登陆窗口
            if (trans.getLoginFlag() == 1)//判断是否登陆成功
            {
                while (trans.getReloginFlag() == 0)//登陆成功 进入循环选择
                {
                    Application.Run(new StageSelect(ref trans));//出现功能选择界面
                    switch (trans.getStage())//根据参数选择对应的功能
                    {
                        case 1: Application.Run(new InForm()); break;//进货系统
                        case 2: Application.Run(new OutForm()); break;//销售系统
                        case 3: Application.Run(new ProviderForm()); break;//供应商系统
                        case 4: Application.Run(new ATMForm()); break;//收银台系统
                    }
                }
            }
        }
    }
}
